let param = [29,10,14,14,37,4]

function minSort(param) {
    let arr = [...param]
    let minIndex = 0
    for(let i=0;i<arr.length-1;i++) {
        minIndex = i
        for(let j=i+1;j<arr.length;j++) {
            let temp = 0
            if (arr[minIndex] > arr[j]) {
                minIndex = j
            }
        }
        temp = arr[i]
        arr[i] =arr[minIndex]
        arr[minIndex] = temp
    }
    return arr
}

console.log(minSort(param))

const arr = [1,2,3]
const [y] = arr
console.log(y)